// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "YoFi/UI/RTMergeNew"
{
    Properties
    {
        _MainTex("Texture", 2D) = "white" {}
    }

        SubShader
    {
        Cull Off
        ZWrite Off
        ZTest Always
        Blend SrcAlpha OneMinusSrcAlpha , One OneMinusSrcAlpha


        Pass
        {
            Tags
            {
                "Queue"="Transparent"
                "IgnoreProjector"="True"
                "RenderType"="Transparent"
                "PreviewType"="Plane"
                "CanUseSpriteAtlas"="True"
            }
            Name "Default"
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma target 2.0
            
            // #pragma shader_feature _ART_EDITOR 

            #include "UnityCG.cginc"
            #include "UnityUI.cginc" 


            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 vertex : SV_POSITION;
            };

            v2f vert(appdata v)
            {
                v2f o;
                o.vertex = UnityObjectToClipPos(v.vertex);
                o.uv = v.uv;
                return o;
            }

            sampler2D _MainTex;

            fixed4 frag(v2f i) : SV_Target
            {
                // Sample the texture
                half4 col1 = tex2D(_MainTex, i.uv);
                half4 result = half(0);

                half3 color1 = (col1.rgb);
                half alpha1 = (col1.a);

                result.rgb = color1.rgb;
                result.a = alpha1;
                // #ifdef _ART_EDITOR
                //     return float4(1.0,0,0,1.0) * result;
                // #else
                    return result;
                // #endif
            }
        ENDCG
        }
    }
}
